@echo off
echo 启动生产环境...

REM 启动Redis集群
start "Redis-6379" redis-server --port 6379
start "Redis-6380" redis-server --port 6380  
start "Redis-6381" redis-server --port 6381

REM 等待Redis启动
timeout /t 5

REM 启动Flask应用集群
start "Flask-5001" gunicorn -w 4 -k gevent --bind 127.0.0.1:5001 app_optimized:app
start "Flask-5002" gunicorn -w 4 -k gevent --bind 127.0.0.1:5002 app_optimized:app
start "Flask-5003" gunicorn -w 4 -k gevent --bind 127.0.0.1:5003 app_optimized:app
start "Flask-5004" gunicorn -w 4 -k gevent --bind 127.0.0.1:5004 app_optimized:app

REM 启动Nginx
start "Nginx" nginx -c nginx.conf

echo 所有服务已启动
pause